<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册页面</title>
    <script type="text/javascript">
        function checkForm() {
            var vuser = document.getElementById("username").value;
            if (vuser == "") {
                alert("用户名不能为空!");
                return false;
            }

            var vtelephone = document.getElementById("telephone").value;
            if(vtelephone.length!=11){
                alert("手机号码输入有误！");
                return false;
            }
            var vpassword = document.getElementById("password").value;
            var vrepassword = document.getElementById("repassword").value;
            if(vrepassword!=vpassword){
                alert("两次密码输入不一致");
                return false;
            }
            var vcredit = document.getElementById("creditcard").value;
            if(vcredit.length!=18){
                alert("身份证号码输入有误");
                return false;
            }
        }
    </script>

</head>
<body>
<form action="xitong.html" onsubmit="return checkForm()">

    <table border="0px" width="450px" height="400px" align="center" cellpadding="0px" cellspacing="0px" bgcolor="#faebd7">

        <tr align="center">
            <td  style="font-size:25px" colspan="2">
                考试系统
            </td>
        </tr>

        <tr>
            <td>
                用户名：
            </td>
            <td >
                <input type="text" name="username" placeholder="请输入用户名" id="username">
            </td>
        </tr>
        <tr>
            <td>
                手机号码：
            </td>
            <td>
                <input type="text" name="telephone" placeholder="请输入手机号码" id="telephone">
            </td>
        </tr>
        <tr>
            <td>
                密码：
            </td>
            <td>
                <input type="password" name="password" placeholder="请输入密码" id="password">
            </td>
        </tr>
        <tr>
            <td>
                确认密码：
            </td>
            <td>
                <input type="password" name="repassword" placeholder="请再次输入密码" id="repassword">
            </td>
        </tr>
        <tr>
            <td>
                身份证号：
            </td>
            <td>
                <input type="password" name="creditcard" placeholder="请输入身份证号码" id="creditcard">
            </td>
        </tr>

        <tr align="center">
            <td colspan="2">
                <input type="submit" value="注册" style="background-color: #b3d4fc" ><input type="reset" style="background-color:silver">
            </td>
            <!--<td>-->
                <!--<input type="reset" >-->
            <!--</td>-->
        </tr>
    </table>
    </div>
</form>


</body>
</html>
